10 REM AIR ATTACK
11 REM COPYRIGHT 1988 BROOKS DEFOREST
12 REM *PUBLIC DOMAIN RELEASED 2007*
20 KEY OFF
30 SCREEN 1:SCREEN 2:SCREEN 0:CLS
40 GOTO 440
50 X=1:Y=1
60 HIGH=10
70 COL=1
80 GROUND=2
90 COLOR GROUND:LOCATE 21,1:PRINT STRING$(80,178):LOCATE 22,1:PRINT STRING$(80,177):LOCATE 23,1:PRINT STRING$(80,176)
100 PLAY "MB":SOUND ON
110 COLOR COL
120 IF COL>13 THEN COL=1:GROUND=2
130 TURN=TURN+1:IF TURN=2 THEN 750
140 FOR X=1 TO 80 STEP 2
150 FOR A=20 TO (20-RND*HIGH) STEP -1
160 LOCATE A,X:PRINT CHR$(176)CHR$(176)
170 NEXT:FOR A=20 TO (20-RND*HIGH) STEP -1:LOCATE A,X:PRINT CHR$(178)CHR$(178):NEXT
180 NEXT
190 Z$=CHR$(32)+CHR$(236)+CHR$(237):E$="   "
200 X=1:Y=1:O=0
210 B$=CHR$(237)+CHR$(236)+CHR$(32)
220 IF O=0 THEN X=X+1 ELSE X=X-1
230 IF X=67 THEN LOCATE Y,X:PRINT E$:Y=Y+1:O=1:X=66
240 IF X=1 THEN LOCATE Y,X:PRINT E$:Y=Y+1:O=0:X=2
250 IF O=0 AND SCREEN(Y,X+4)<>32 THEN 380
260 IF O=1 AND SCREEN(Y,X-1)<>32 THEN 380
270 V=V-1:IF V<1 THEN V=15                                          
280 SOUND 10,1,V,1
290 COLOR GROUND+2
300 IF A$="q" OR A$="Q" THEN EXIT
310 IF O=0 THEN LOCATE Y,X:PRINT Z$ ELSE LOCATE Y,X:PRINT B$
320 A$=INKEY$
330 IF A$=" " AND K$="" THEN K$="*":F1=X:F2=Y:NOISE 1,15,2
340 COLOR GROUND+1
350 IF K$="*" THEN LOCATE F2,F1:PRINT " ":F2=F2+1:LOCATE F2,F1:PRINT "!":IF SCREEN(F2+1,F1)<>32 THEN LOCATE F2,F1:PRINT " ":LOCATE F2+1,F1:PRINT " ":NOISE 4,15,2:K$="":LOCATE F2+1,F1+1:PRINT " ":NOISE 4,15,2
360 IF Y=8 THEN COL=COL+1:COLOR 4:GROUND=GROUND+1:HIGH=HIGH+2:FOR S=1 TO 10:LOCATE 13-S,40-S:PRINT STRING$(S*2,177):LOCATE 13+S,40-S:PRINT STRING$(S*2,176):NEXT:FOR Y=1 TO 23:LOCATE Y,1:PRINT STRING$(80,32):NEXT:GOTO 90
370 GOTO 220
380 FOR A=1 TO 50:LOCATE 12,A:PRINT " G A M E  O V E R"
390 NEXT
400 FOR A=50 TO 1 STEP -1:LOCATE 12,A:PRINT "G A M E  O V E R ":NEXT
410 FOR P=15 TO 0 STEP -1:PALETTE COL,P:FOR A=1 TO 100:NEXT:NEXT
420 FOR P=15 TO 0 STEP -1:PALETTE GROUND,P:FOR A=1 TO 100:NEXT:NEXT
430 RUN
440 CLS
450 FOR P=0 TO 15:PALETTE P,P:NEXT
460 COLOR 2:LOCATE 21,1:PRINT STRING$(80,178)
470 LOCATE 22,1:PRINT STRING$(80,177)
480 LOCATE 23,1:PRINT STRING$(80,176)
490 COLOR 4:LOCATE 1,1:PRINT STRING$(160,176)
500 COLOR 4:PRINT STRING$(160,177)
510 PRINT STRING$(160,178)
520 COLOR 12:PRINT STRING$(160,176)
530 PRINT STRING$(160,177):PRINT STRING$(160,178)
540 COLOR 5
550 PRINT STRING$(160,176)
560 PRINT STRING$(160,177):PRINT STRING$(160,178)
570 COLOR 13
580 PRINT STRING$(80,177):PRINT STRING$(80,178)
590 COLOR 1
600 FOR X=1 TO 80 STEP 2
610 FOR A=20 TO 20-RND*15 STEP -1
620 LOCATE A,X:PRINT CHR$(178)CHR$(178)
630 NEXT:NEXT
640 COLOR 7
650 LOCATE 12,30:PRINT "A I R    A T T A C K !"
660 FOR S=400 TO 300 STEP -10
670 SOUND S,1,15,0
680 B$=A$
690 NEXT
700 A$=INKEY$:IF A$="" THEN 700
710 IF A$="q" OR A$="Q" THEN EXIT 
720 IF A$=" " THEN CLS:GOTO 50
730 GOTO 700
740 SCREEN 1:SCREEN 2:SCREEN 0
750 FOR X=2 TO 77 STEP 2
760 COLOR COL:YY=RND*HIGH:FOR A=20 TO 20-YY STEP -1
770 LOCATE A,X:PRINT CHR$(177)CHR$(177):Q=Q+1:IF Q=1 THEN COLOR COL ELSE COLOR COL+2:Q=0
780 NEXT
790 COLOR COL+1:FOR B=X-1 TO X+3:LOCATE A,B:PRINT CHR$(177)
800 NEXT
810 NEXT
820 TURN=0:GOTO 200
